package com.itqf.yun.controller;
import com.itqf.yun.mapper.ProductMapper;
import com.itqf.yun.pojo.Product;
import com.itqf.yun.service.ProductService;
import com.itqf.yun.vo.R;
import com.sun.corba.se.spi.resolver.Resolver;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
@RestController
@CrossOrigin("*")
@RequestMapping("product")
public class ProductController {
    @Autowired
    private ProductService productService;

    /**
     * 删除方法
     * @param
     * @return
     */

    @GetMapping("delete")
    public Object delete(int pid){
        R r = productService.delete(pid);
        return r;
    }


    /**
     * 展示
     * @return
     */

    @GetMapping("list")
    public Object list(){
        R r = productService.list();

        return r;
    }



}
